
#delimit;
set more off;


cd "C:\....\Replication files";
	
use "ENMI - replication.dta", clear;

	
 #delimit;
 set more off;
 
/* FE replications using the economic dimensions rather than ENMI	*/

gen econdims=dim4+dim5;



set more off;
xtreg pvote
	c.ensh_mi##i.inc_cab_l
	c.econdims##i.inc_cab_l pvote_l ,
 fe robust;

 estimate store econdims_simple;
 

xtreg pvote
	c.ensh_mi##i.inc_cab_l
	c.econdims##i.inc_cab_l pvote_l
	c.GDPgrowth##i.inc_cab_l
	c.moderate##i.inc_cab_l

	1.nparty
 majelect federal directpres ,
 fe robust;
		
		 estimates store  econdims_full;	
		 
		 xtreg pvote
		 	c.ensh_mi
c.econdims pvote_l
	c.GDPgrowth
	moderate

	1.nparty
 majelect federal directpres if inc_cab_l==0,
 fe robust;
		
		 estimates store  econdims_opponly;	
	
	
	xtreg pvote
		c.ensh_mi#i.inc_cab_l
	c.econdims#i.inc_cab_l pvote_l
	c.GDPgrowth#i.inc_cab_l
	c.moderate#i.inc_cab_l

	1.nparty
 majelect federal directpres if inc_cab_l==1,
 fe robust;
		
		 estimates store  econdims_incumbentonly;	
		

	 #delimit;
 esttab  econdims_opponly econdims_incumbentonly econdims_full 
			using "figures\Table A4 - Economic dimensions.rtf", replace 
		b (%10.3f) se scalars("aic AIC" "bic BIC" "rmse Root Mean Squared Error" "ll Log-Likelihood" ) 
		obslast star(+ 0.10 * 0.05 ** 0.01 *** 0.001)
		label mtitles ( "Opposition" "Incumbents" "Full") nogaps
		title (\label{})
order(ensh_mi
1.inc_cab_l#c.ensh_mi
	econdims 
1.inc_cab_l#c.econdims 
moderate 
1.inc_cab_l#c.moderate
GDPgrowth

1.inc_cab_l#c.GDPgrowth 
1.inc_cab_l 

 majelect pvote_l _cons )

keep(ensh_mi
1.inc_cab_l#c.ensh_mi
econdims 1.inc_cab_l 
1.inc_cab_l#c.econdims GDPgrowth 
1.inc_cab_l#c.GDPgrowth 
1.inc_cab_l#c.moderate
moderate majelect 
pvote_l _cons )  

 coeflabels(ensh_mi "ENMI"
1.inc_cab_l#c.ensh_mi "Incumbent X ENMI"
econdims "Economic Dimensions" 
1.inc_cab_l "Incumbent"
1.inc_cab_l#c.econdims "Incumbent X Economic Dimensions" 
GDPgrowth "GDP Growth Rate" 
1.inc_cab_l#c.GDPgrowth "Incumbent X GDP Growth Rate"
1.inc_cab_l#c.moderate "Incumbent X Moderated Position"
moderate "Moderated Position"
majelect "Majoritarian Election"
pvote_l "% Vote{\sub t-1}"
_cons "Constant")
addnotes("Note: The Dependent variable is percentage vote for the party.");

